app.controller('fuzerenCtrl',['$scope','$http','$location','mainService',function ($scope,$http,$location,mainService) {
    var token = localStorage.getItem('token');
    var changing = '';
    if(mainService.getData().incoming =='liuzhuan'){

        changing = "/om/om-staff!findApproveBy.action";
    }else {

        changing = '/om/om-staff!findMutiByPage.action';
    }
    $http({
        method: "POST",
        url: mainUrl+changing,
        params: {
            'Authorization': token,
            'qm.staffState':1,
            'page':1,
            'start':0,
            'limit':15,


        }
    }).then(
        function(data, status, headers, config){
            $scope.item=data.data.items;
            console.log(data);
        },function(data, status, headers, config){

        }
    );
$scope.sending = function ($event) {
    if (mainService.getData().page == 'luru') {
        mainService.getData().fzrData = $event;
        mainService.getData().fzr = $event.staffName;
        console.log(mainService.getData())
        console.log(mainService.getData().dateInput)
        $location.path('/yinhuanluru')
    }else if(mainService.getData().incoming){
        mainService.getData().slrData = $event;
        mainService.getData().slr = $event.staffName;
        console.log(mainService.getData())
        console.log(mainService.getData().dateInput);
        $location.path('/liuzhuandaichuliyinhuanziye')
    }
    else {
        mainService.getData().slrData = $event;
        mainService.getData().slr = $event.staffName;
        console.log(mainService.getData())
        console.log(mainService.getData().dateInput);
        $location.path('/yinhuanliuzhuan')
    }
}
}]);